package com.sunjob.common.domain.message;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Wangzurong
 * @create 2022-08-05 15:07
 */
@Data
public class SysNoticeSelector {
    private SysNotice sysNotice;
    private List<Long> ids;
    private boolean selectAll;
    /** 0 角色 1 部门*/
    private Integer type;
    public SysNoticeSelector(){

    }
    public SysNoticeSelector(Integer type){
        if(type!=0&&type!=1){
            throw  new RuntimeException("错误的类型");
        }
        this.type = type;
        this.ids= new ArrayList<>();
    }
    public SysNoticeSelector withSysNotice(SysNotice sysNotice){
        this.sysNotice = sysNotice;
        return this;
    }
    public SysNoticeSelector withId(Long id){
        this.ids.add(id);
        return this;
    }
    public SysNoticeSelector withAll(){
        this.selectAll = true;
        return this;
    }

}
